home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / lang / c--c0202 / sound.h-- < prev    next >
Encoding:
Text File  |  1993-05-13  |  1.0 KB  |  51 lines

  1. /*
  2.     SPHINX Programming (C) 1993.
  3.     TITLE:  SOUND.H--
  4.     DESCRIPTION:  This file contains a collection of procedures for using
  5.                   the built in PC speaker.
  6.     LAST MODIFIED:  13 May 1993
  7.     PROCEDURES DEFINED IN THIS FILE:
  8.         : void NOSOUND()
  9.         : void SOUND(frequency)
  10. */
  11.  
  12.  
  13. : void NOSOUND ()
  14. /*
  15. Silences the speaker.
  16. */
  17. {
  18. $IN AL,0x61                              
  19. AL &= 0xFC;                              
  20. $OUT 0x61,AL                              
  21. /* RETURNS:  AL = undefined
  22. */
  23.  
  24.  
  25.  
  26. : void SOUND ()  /* AX = frequency */
  27. /*
  28. Starts the speaker emiting a sound of a given frequency
  29. */ 
  30. {
  31. BX = AX;
  32. DX = 0x12;
  33. AX = 0x34DC;
  34. $DIV BX                                 
  35. BL = AL;
  36. AL = 0xB6;
  37. $OUT 0x43,AL                              
  38. AL = BL;
  39. $OUT 0x42,AL                              
  40. AL = AH;
  41. $OUT 0x42,AL                              
  42. $IN AL,0x61                              
  43. AL |= 3;
  44. $OUT 0x61,AL                              
  45. }
  46. /* RETURNS:  AX,BX,DX = undefined
  47. */
  48.  
  49.  
  50. /* end of SOUND.H-- */